x11/dnd: Ignore XErrors from the COW
authorOlivier Fourdan <ofourdan@redhat.com>
Mon, 22 Mar 2021 14:34:31 +0000 (15:34 +0100)
committerOlivier Fourdan <ofourdan@redhat.com>
Mon, 22 Mar 2021 14:38:58 +0000 (15:38 +0100)
The DnD code for X11 adds the composite overlay window (aka COW) to the
cache.

Yet the X11 requests to get and release the COW may trigger XErrors that
we ought to ignore otherwise the client will abort.

Fixes: #3715
gdk/x11/gdkdrag-x11.c

index d8c9ac28b8c2188dc0a1728e8c9220cab4ac9dd6..d82d3a7d4b5a95f2ebf03b5fa0befdfeebecbe72 100644 (file)
@@ -581,12 +581,14 @@ gdk_surface_cache_new (GdkDisplay *display)
    */
   if (gdk_display_is_composited (display))
     {
+      gdk_x11_display_error_trap_push (display);
       cow = XCompositeGetOverlayWindow (xdisplay, xroot_window);
       gdk_surface_cache_add (result, cow, 0, 0,
                            WidthOfScreen (GDK_X11_SCREEN (screen)->xscreen),
                            HeightOfScreen (GDK_X11_SCREEN (screen)->xscreen),
                            TRUE);
       XCompositeReleaseOverlayWindow (xdisplay, xroot_window);
+      gdk_x11_display_error_trap_pop_ignored (display);
     }
 #endif